All Questions
8 questions
0votes
1answer
1kviews
How to expose C++ static library interface, extending Pimpl to an abstract interface
Until today I had a static C++ library with no separation between the public interface and internal headers. My other apps just linked to it, included the required headers, and used whatever they ...
1vote
1answer
118views
Can this simple Bank example be considered as a valid Abstract Factory?
For teaching purposes, I'm trying to replicate in a more faithful way from this conceptual UML (from wikipedia): In a "so-so" real world example, in my case, families of Loans and Insurances: So, can ...
3votes
1answer
4kviews
Should an abstract class implement an interface, as opposed to defining its own abstract methods?
I'm defining a class structure for persisting to our cassandra database, and I'm unsure about using a combination of an abstract class and an interface. I have two concrete classes, one for persisting ...
0votes
3answers
368views
Send records using async or sync way
I have bunch of keys and values that I want to send to our messaging queue by packing them in one byte array. I will make one byte array of all the keys and values which should always be less than 50K ...
2votes
1answer
2kviews
How to avoid the static_cast/dynamic_cast in `Abstract Factory` design pattern?
We are using Abstract Factory design pattern in our project, as the project became complex, most of the time the concrete class functionality need to separate to multiple class. As the following code ...
0votes
3answers
9kviews
Strategy Pattern with abstract class instead of interface?
Is the strategy in the strategy pattern always an interface? What pattern would it be when the strategy is abstract?
18votes
5answers
13kviews
Do enums create brittle interfaces?
Consider the example below. Any change to the ColorChoice enum affects all IWindowColor subclasses. Do enums tend to cause brittle interfaces? Is there something better than an enum to allow for ...
2votes
2answers
868views
Should an abstract class always abstract its methods to an interface?
I had learned sometime ago that abstract classes should always abstract their functions to an interface. So instead of having something like this - abstract class a{ public int i; public int ...